package com.jlkf.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.jlkf.service.VipInfoService;

@Controller
@RequestMapping("/vip")
public class VipInfoController {

	@Autowired
	private VipInfoService vipInfoService;
	
	/**
     * 查看vip列表
     */
	@ResponseBody
	@RequestMapping(value = "/selectVipList",method = RequestMethod.POST)
	public Object selectVipList(){
		return vipInfoService.selectVipList();
	}
	
	/**
	 * 成为VIP
	 */
	@ResponseBody    
	@RequestMapping(value="APPInsertVip",method = RequestMethod.POST)  
    public Object APPInsertVip(Long userid,Integer vipid,String payMethod,String body,String subject,String payMoney,String password,HttpServletRequest request) throws Exception{   	  
    	return vipInfoService.APPInsertVip(userid, vipid,payMethod, body, subject, payMoney,request.getRemoteAddr(),password);
    }
	
	/**
	 * 是否为VIP
	 */
	@ResponseBody    
	@RequestMapping(value="isVIP")  
    public Object isVIP(Long userId){   	  
    	return vipInfoService.isVIP(userId);
    }
	
	/**
	 * 成为VIP
	 */
	@ResponseBody    
	@RequestMapping(value="IOSInsertVip")  
   public Object IOSInsertVip(Long userid,Integer vipid,String payMoney) throws Exception{   	  
   	return vipInfoService.IosInsertVip(userid, vipid, payMoney);
   }
}
